import QtQuick 2.8
import QtQuick.Particles 2.0

Item {
    id: item
    anchors.fill: parent

    property alias emitter: emitter

    ParticleSystem{ id: sys }

    ImageParticle{
        system: sys
        source: "qrc:/dot.png"
        color: "red"
        alpha: 0.5

//        SequentialAnimation on color {
//            loops: Animation.Infinite
////            ColorAnimation {
////                from: "cyan"
////                to: "magenta"
////                duration: 1000
////            }
////            ColorAnimation {
////                from: "magenta"
////                to: "blue"
////                duration: 2000
////            }
////            ColorAnimation {
////                from: "blue"
////                to: "violet"
////                duration: 2000
////            }
////            ColorAnimation {
////                from: "violet"
////                to: "cyan"
////                duration: 2000
////            }
//        }
//        colorVariation: 0.3
    }

    Emitter{
        id: emitter
        system: sys

        emitRate: 50
        lifeSpan: 1000

        size: 8
        sizeVariation: 4

        velocity: PointDirection { xVariation: 8; yVariation: 8; }
        acceleration: PointDirection { xVariation: 4; yVariation: 4;}

        velocityFromMovement: 8
    }
}
